package com.jsits.v2x.hurys.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class DetectVehicleListDto {
    @JsonProperty(value = "ID")
    private int ID;
    @JsonProperty(value = "Length")
    private float length;
    @JsonProperty(value = "XPos")
    private float xPos;
    @JsonProperty(value = "YPos")
    private float yPos;
    @JsonProperty(value = "XSpeed")
    private float xSpeed;
    @JsonProperty(value = "YSpeed")
    private float ySpeed;

    public Integer getSpeed() {
        double temp = Math.sqrt(Math.pow(xSpeed,2) + Math.pow(ySpeed,2));
        Integer speed = (int) Math.ceil(temp);
        return speed;
    }
}
